package com.BEASTMODE.games.SpeedPong;

import com.BEASTMODE.libs.OpenGL;
import com.BEASTMODE.libs.GameThread;
import com.BEASTMODE.libs.StateManager;
import android.app.Activity;
import android.view.MotionEvent;

public class SpeedPong extends GameThread 
{
	OpenGL _renderer;
	StateManager _state_manager;
	
	public SpeedPong(Activity activity)
	{
		super(activity);
		_state_manager = new StateManager();
		_state_manager.ChangeState(GameState.GetInstance());
	}
	
	// 
	// This function is called every frame
	// It should not loop infinitely
	//
	@Override
	protected void DoWork(float dT)
	{
		if (_state_manager.Update(dT))
		{
			// Game update Here
		}
		else
		{
			//Exit Application
			super._activity.finish();
		}
	}
	
	@Override
	protected void Stopping()
	{
		_state_manager.ChangeState(null);
	}
	
	@Override
	public void TouchEventReceived(MotionEvent evt) 
	{
		
	}
}
